import Layout from "@/layout/layout.vue";
import Error from "@/views/error.vue";
import { RouteRecordRaw } from "vue-router";
import Login from "@/views/login.vue";
import Iframe from "@/views/iframe.vue";

/**
 * 框架基础路由
 */
const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    component: Layout,
    redirect: "/home",
    meta: { title: "工作台", icon: "icon-desktop" },
    children: [
      {
        path: "/home",
        component: () => import("@/views/home.vue"),
        meta: { title: "主页", icon: "icon-home" }
      }
    ]
  },
  {
    path: "/login",
    component: Login,
    meta: { title: "登录", isNavigationMenu: false }
  },
  {
    path: "/user/password",
    component: () => import("@/views/sys/user-update-password.vue"),
    meta: { title: "修改密码", requiresAuth: true, isNavigationMenu: false }
  },
  {
    path: "/iframe/:id?",
    component: Iframe,
    meta: { title: "iframe", isNavigationMenu: false }
  },
  {
    path: "/error",
    name: "error",
    component: Error,
    meta: { title: "错误页面", isNavigationMenu: false }
  },
  {
    path: "/:path(.*)*",
    redirect: { path: "/error", query: { to: 404 }, replace: true },
    meta: { isNavigationMenu: false }
  },
  {
    path: "/study/student/edit",
    component: () => import("@/views/study/student-add-or-update.vue"),
    meta: { title: "新增学生", requiresAuth: true, isNavigationMenu: false }
  },
  {
    path: "/study/grade/edit",
    component: () => import("@/views/study/grade-add-or-update.vue"),
    meta: { title: "新增年级", requiresAuth: true, isNavigationMenu: false }
  },
  {
    path: "/study/class/edit",
    component: () => import("@/views/study/class-add-or-update.vue"),
    meta: { title: "新增班级", requiresAuth: true, isNavigationMenu: false }
  },
  {
    path: "/study/base/edit",
    component: () => import("@/views/study/base-add-or-update.vue"),
    meta: { title: "新增基地", requiresAuth: true, isNavigationMenu: false }
  },
  {
    path: "/study/base/user/edit",
    component: () => import("@/views/study/base-user-add-or-update.vue"),
    meta: { title: "新增基地账号", requiresAuth: true, isNavigationMenu: false }
  },
  {
    path: "/study/school/edit",
    component: () => import("@/views/study/school-add-or-update.vue"),
    meta: { title: "新增学校", requiresAuth: true, isNavigationMenu: false }
  },
  {
    path: "/study/school/user/edit",
    component: () => import("@/views/study/school-user-add-or-update.vue"),
    meta: { title: "新增学校账号", requiresAuth: true, isNavigationMenu: false }
  },
  {
    path: "/study/notice/edit",
    component: () => import("@/views/study/notice-add-or-update.vue"),
    meta: { title: "新增公告", requiresAuth: true, isNavigationMenu: false }
  },
  {
    path: "/study/event/edit",
    component: () => import("@/views/study/event-add-or-update.vue"),
    meta: { title: "新增研学", requiresAuth: true, isNavigationMenu: false }
  },
  {
    path: "/study/project/edit",
    component: () => import("@/views/study/project-add-or-update.vue"),
    meta: { title: "新增项目", requiresAuth: true, isNavigationMenu: false }
  },
  {
    path: "/study/merch/edit",
    component: () => import("@/views/study/merch-add-or-update.vue"),
    meta: { title: "新增周边", requiresAuth: true, isNavigationMenu: false }
  },
  {
    path: "/study/merchtype/edit",
    component: () => import("@/views/study/merchtype-add-or-update.vue"),
    meta: { title: "新增周边类型", requiresAuth: true, isNavigationMenu: false }
  },
  {
    path: "/study/base/person",
    component: () => import("@/views/study/base-person.vue"),
    meta: { title: "人员核验", requiresAuth: true, isNavigationMenu: false }
  },
  {
    path: "/study/base/event-complete/person",
    component: () => import("@/views/study/base-event-complete-person.vue"),
    meta: { title: "结营确认", requiresAuth: true, isNavigationMenu: false }
  },
];

export default routes;
